package cong.cheng.quartz;

import org.quartz.*;

import java.util.Date;

public class MyJob implements Job {

    private  String name;

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
//        System.out.printf("MyJob execute"+new Date());
        JobDataMap jobDetailMap = jobExecutionContext.getJobDetail().getJobDataMap();
        JobDataMap TriggerMap = jobExecutionContext.getTrigger().getJobDataMap();
        JobDataMap mergeMap=jobExecutionContext.getMergedJobDataMap();
        System.out.println("jobDetailMap："+jobDetailMap.getString("Job"));
        System.out.println("TriggerMap："+TriggerMap.getString("Trigger"));
        System.out.println("mergeMap："+mergeMap.getString("Trigger"));

//        try {
//            Thread.sleep(2000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
    }
}

